package com.learn.kotlinlearndemolist.custom

import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.Toast
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.databinding.DataBindingUtil
import com.learn.kotlinlearndemolist.R
import com.learn.kotlinlearndemolist.databinding.CustomLayoutBinding

class CustomLayout(context: Context, attrs: AttributeSet?) : ConstraintLayout(context, attrs) {

    var mBinding: CustomLayoutBinding = DataBindingUtil.inflate(
        LayoutInflater.from(context),
        R.layout.custom_layout,
        this,
        false
    )

    init {
        mBinding.privacyContent.setOnClickListener {
            Toast.makeText(context, mBinding.privacyContent.text, Toast.LENGTH_SHORT).show()
        }
        mBinding.agreementContent.setOnClickListener {
            Toast.makeText(context, mBinding.agreementContent.text, Toast.LENGTH_SHORT).show()
        }
    }
}